# Makefile for the C version of 'hey'
# Author: Cian Synnott <pooka@redbrick.dcu.ie>
# Date: Sun Nov 15 22:36:01 GMT 1998
# 

prefix      = @prefix@
exec_prefix = @exec_prefix@


PREFIX      = @prefix@
MANDIR      = @mandir@
INSTALL	    = @INSTALL@
BINDIR	    = @bindir@
INSTALL_DIR = ${INSTALL} -m 0755 -d
INSTALL_PROG = ${INSTALL} -m 0755 
INSTALL_DATA = ${INSTALL} -m 0644

CC = @CC@
@SET_MAKE@


DEBUG =  # -g -D_DEBUG
INCLUDE = -I. -I/usr/local/include  
CFLAGS = @CFLAGS@ ${DEBUG} ${INCLUDE}

OBJECTS = hey_main.o hey_arg.o hey_format.o hey_readline.o @EDIT_OBJ@ \
	  hey_signal.o hey_logins.o dyn_page.o g_list.o aux.o @UT_OBJ@

BINARY = c-hey

all: ${BINARY} Makefile

${BINARY}: ${OBJECTS}
	${CC} ${CFLAGS} -o ${BINARY} ${OBJECTS} @LIBS@

# generated by  'gcc -MM *.c'
aux.o: 		aux.c aux.h config.h
dyn_page.o: 	dyn_page.c dyn_page.h
g_list.o: 	g_list.c g_list.h
hey_arg.o: 	hey_arg.c hey_arg.h g_list.h utent.h config.h aux.h
hey_edit.o: 	hey_edit.c hey_edit.h hey_readline.h config.h hey_format.h \
		dyn_page.h hey_arg.h g_list.h utent.h aux.h
hey_format.o: 	hey_format.c hey_format.h dyn_page.h hey_arg.h g_list.h \
 		utent.h config.h hey_readline.h aux.h
hey_logins.o: 	hey_logins.c hey_logins.h hey_arg.h g_list.h utent.h \
		config.h aux.h
hey_main.o: 	hey_main.c hey_arg.h g_list.h utent.h config.h \
		hey_format.h dyn_page.h hey_signal.h hey_logins.h hey_readline.h \
		hey_edit.h aux.h
hey_readline.o: hey_readline.c hey_readline.h config.h hey_edit.h \
		hey_format.h dyn_page.h hey_arg.h g_list.h utent.h aux.h
hey_signal.o: 	hey_signal.c hey_signal.h hey_readline.h config.h \
		hey_edit.h aux.h
utent.o: 	utent.c utent.h config.h

install: mkcat stripped
	$(INSTALL_DIR) ${BINDIR}
	$(INSTALL_PROG) ${BINARY} ${BINDIR}
	ln -fs ${BINDIR}/${BINARY} ${BINDIR}/hey

mkcat:
	$(INSTALL_DIR) ${MANDIR}/man1
	$(INSTALL_DATA) doc/${BINARY}.1 ${MANDIR}/man1/
	ln -fs ${MANDIR}/man1/${BINARY}.1 ${MANDIR}/man1/hey.1

deinstall:
	rm -f ${MANDIR}/man1/${BINARY}.1
	rm -f ${MANDIR}/man1/hey.1
	rm -f ${BINDIR}/${BINARY}
	rm -f ${BINDIR}/hey

stripped: all 
	strip ${BINARY}

clean: 
	rm -f *.o ${BINARY} 

distclean: clean
	rm -f Makefile config.h config.log config.status config.cache tags
